package com.xiaor.rssprovince.service.impl;

import com.xiaor.rssprovince.dao.ProvinceDao;
import com.xiaor.rssmodel.model.Province;
import com.xiaor.rssprovince.service.ProvinceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProvinceServiceImpl implements ProvinceService {
    @Autowired
    private ProvinceDao provinceDao;
    private static Logger logger = LoggerFactory.getLogger(ProvinceServiceImpl.class);

    @Override
    public List<Province> findAll() {
        List<Province> provinceList = null;
        try {
            provinceList = provinceDao.findAll();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("findAll|查询失败");
        }
        return provinceList;
    }
}
